﻿
@{

    ViewBag.Title = "生成排班";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<!DOCTYPE html>

<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>


<script>

    $(function () {
        GridInit();
    });
    
    function GridInit() {
        var $gridList = $("#gridList");
        var myDate = new Date(); 
        var time = myDate.getFullYear() + "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() + " " +"00:00:00";
        $gridList.dataGrid({
            url: "/OutPatientManage/OutBook/CreateSchedule?time="+time,
            autowidth: true,
            height: $(window).height() - 118,
            colModel: [
                { label: "ghpbId", name: "ScheduId", hidden: true },
                { label: "编号", name: "ghpbId", width: 40, align: 'left' },
                {
                    label: "出诊日期", name: "OutDate", width: 120, align: 'left', formatter: function (val) {
                        if (val.indexOf("T")) {
                            return val.replace('T', ' ');
                        } else {
                            return val;
                        }
                    }
                },
                { label: "医生工号", name: "ysgh", width: 80, align: 'left', hidden: true },
                { label: "医生姓名", name: "ysxm", width: 100, align: 'left' },
                { label: "出诊科室", name: "czks", width: 80, align: 'left', hidden: true},
                { label: "出诊科室名称", name: "czksmc", width: 80, align: 'left' },
                {
                    label: "挂号类型", name: "RegType", width: 60, align: 'left', formatter: function (val) {
                        if (val == "1") {
                            return "普通门诊";
                        }
                        else if (val == "2") {
                            return "急诊";
                        } else if (val == "3") {
                            return "专家门诊";
                        }
                        else if (val == "4") {
                            return "特病门诊";
                        }
                        else if (val == "5") {
                            return "重大疾病门诊";
                        }
                        else if (val == "6") {
                            return "慢性病门诊";
                        }
                        else if (val == "7") {
                            return "居民两病";
                        }
                        else if (val == "8") {
                            return "意外伤害门诊";
                        }
                        else if (val == "9") {
                            return "生育门诊";
                        }
                        else if (val == "10") {
                            return "耐多药结核门诊";
                        }
                        else if (val == "11") {
                            return "儿童两病门诊";
                        }
                    }
                },
                { label: "职称", name: "Title", width: 90, align: 'left' },
                { label: "出诊时间段", name: "PeriodDesc", width: 80, align: 'left' },
                { label: "号源", name: "TotalNum", width: 60, align: 'left' },
                { label: "开始时间", name: "PeriodStart", width: 80, align: 'left' },
                { label: "结束时间", name: "PeriodEnd", width: 80, align: 'left' },
                { label: "挂号费", name: "RegFee", width: 60, align: 'left' },
                {
                    label: "是否开放网络预约挂号", name: "IsBook", width: 100, align: 'left', formatter: function (val) {
                        if (val == "1") {
                            return "是";
                        }
                        else if (val == "0") {
                            return "否";
                        }
                    }
                },
                { label: "挂号项目", name: "sfxmmc", width: 80, align: 'left' },
                { label: "附加项目", name: "zlxmmc", width: 120, align: 'left' },
                {
                    label: "星期", name: "weekdd", width: 80, align: 'left', formatter: function (val) {
                        if (val == "1") {
                            return "星期一";
                        }
                        else if (val == "2") {
                            return "星期二";
                        }
                        else if (val == "3") {
                            return "星期三";
                        }
                        else if (val == "4") {
                            return "星期四";
                        }
                        else if (val == "5") {
                            return "星期五";
                        }
                        else if (val == "6") {
                            return "星期六";
                        }
                        else if (val == "7") {
                            return "星期日";
                        }
                    }
                },
            ],
            sortname: "ScheduId desc",
            rowNum: 10,
            pager: "#gridPager",
            viewrecords: true,
        });
    }
</script>
